﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8">
    <link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
    <link rel="bookmark" type="image/ico" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="/Content/layui/css/layui.css" rel="stylesheet" />
    <link href="/Content/select2/css/select2.css" rel="stylesheet" />
    <link href="/Content/framework/css/console.css" rel="stylesheet" />
    <link href="/Content/framework/css/animate.css" rel="stylesheet" />
    <link href="/Content/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <script src="/Content/jquery/jquery.min.js"></script>
    <script src="/Content/jquery/jquery.md5.js"></script>
    <script src="/Content/layui/layui.js"></script>
    <script src="/Content/select2/js/select2.min.js"></script>
    <script src="/Content/framework/js/global.js"></script>
</head>
<body>
    <form id="form" class="layui-form" style="margin-top: 25px">

        <div class="layui-form-item">
            <label class="layui-form-label" style="width:200px">主题</label>
            <div class="layui-input-inline" style="width:500px">
                @if (ViewBag.Theme == "blue")
                {
                    <input type="radio" name="Theme" value="blue" title="蓝色" checked>
                    <input type="radio" name="Theme" value="gray" title="灰色">
                    <input type="radio" name="Theme" value="black" title="黑色">
                }
                else if (ViewBag.Theme == "gray")
                {
                    <input type="radio" name="Theme" value="blue" title="蓝色">
                    <input type="radio" name="Theme" value="gray" title="灰色" checked>
                    <input type="radio" name="Theme" value="black" title="黑色">
                }
                else if (ViewBag.Theme == "black")
                {
                    <input type="radio" name="Theme" value="blue" title="蓝色">
                    <input type="radio" name="Theme" value="gray" title="灰色">
                    <input type="radio" name="Theme" value="black" title="黑色" checked>
                }
                else
                {
                    <input type="radio" name="Theme" value="blue" title="蓝色" checked>
                    <input type="radio" name="Theme" value="gray" title="灰色">
                    <input type="radio" name="Theme" value="black" title="黑色">
                }
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-inline" style="margin-left:300px">
                <button id="btnSubmit" class="layui-btn" lay-submit lay-filter="save">保存</button>
            </div>
        </div>
    </form>

    <script>
        layui.config({
            base: parent._baseUrl
        }).use(['form'], function() {
            var form = layui.form;
            form.on('submit(save)', function(data) {
                $.ajax({
                    url: "/theme",
                    data: data.field,
                    type: "post",
                    async: false,
                    dataType: "json",
                    success: function(data) {
                        $.layerMsg(data.message, data.state);
                    },
                    error: function(xhr, status, error) {
                        $.layerMsg(error, "error");
                    }
                });
                return false;
            });
        });
    </script>
</body>
</html>